/**
 * 配置路由表
 */
import React from 'react'
import { NavigationContainer } from '@react-navigation/native'
import { createNativeStackNavigator } from '@react-navigation/native-stack'
import Home from './screens/Home'

let navigatorsList = [
    {
        name: 'Home',
        screen: Home
    }
]

const Stack = createNativeStackNavigator()
// 在这里配置除Tab页以外的页面
// 1.栈路由 主要是用作编程式导航
// 顶部 底部 抽屉 3种导航方式
export default class navigators extends React.Component {
    constructor(props) {
        super(props)
    }
    state = {

    }

    // 1.状态组件的生命周期函数
    componentDidMount() {

    }

    render() {
        return (
            <NavigationContainer>
                <Stack.Navigator
                    screenOptions={{ headerShown: false }}>
                    {
                        navigatorsList.map((item, index) => {
                            return (
                                <Stack.Screen
                                    name={item.name}
                                    component={item.screen}
                                    key={index}
                                />
                            )
                        }
                        )
                    }
                </Stack.Navigator>
            </NavigationContainer>
        )
    }
}